import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
  liuDeHua: 0,
  guoFuCheng: 0,
  liMing: 0,
  zhangXueYou: 0,
}
const mutations = {
  CHANGE_LIU_DE_HUA(state) {
    state.liuDeHua += 1
  },
  CHANGE_GUO_FU_CHENG(state) {
    state.guoFuCheng += 2
  },
  CHANGE_ZHANG_XUE_YOU(state, payload) {
    state.zhangXueYou += payload
  },
  CHANGE_STATE(state, { prop = 'liMing', vote = 1 }) {
    state[prop] += vote
  },
}
export default new Vuex.Store({
  //数据的状态
  state,
  //更改数据状态
  mutations,
  //命令
  actions: {},
  //统计，计算一些内容
  getters: {},
})
